package com.ruoyan.service;

import com.ruoyan.dao.BooksMapper;
import com.ruoyan.pojo.Books;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Package: com.ruoyan.service
 * @ClassName: BooksServiceImpl
 * @Author: ruoyan1998
 * @CreateTime: 2021/5/5 15:26
 * @Description:
 */
@Service
public class BooksServiceImpl implements BooksService
{
    /**
     * service层实现Dao层接口*/
    private BooksMapper booksMapper;

    /**
     * set方法注入*/
    public void setBooksMapper(BooksMapper booksMapper)
    {
        this.booksMapper = booksMapper;
    }

    public int addBooks(Books books)
    {
        return booksMapper.addBooks(books);
    }

    public int deleteBooks(int id)
    {
        return booksMapper.deleteBooks(id);
    }

    public int updateBooks(Books books)
    {
        return booksMapper.updateBooks(books);
    }

    public List<Books> queryBooks()
    {
        return booksMapper.queryBooks();
    }

    public Books queryBooksByID(int id)
    {
        return booksMapper.queryBooksByID(id);
    }

    public Books queryBookByName(String name)
    {
        return booksMapper.queryBookByName(name);
    }
}
